package com.owc.common.sdk.request;

import com.owc.common.sdk.AbstractRequest;
import com.owc.common.sdk.response.BalanceResponse;
import com.owc.common.sdk.response.EthTransferResponse;
import lombok.Data;
import org.apache.http.entity.ContentType;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @Author xiaom
 * @Date 2019/12/17 10:38
 * @Version 1.0.0
 * @Description <>
 **/
@Data
public class EthTransferRequest extends AbstractRequest implements Request<EthTransferResponse> {

    protected String address;

    protected BigDecimal amount;

    protected String traceId;

    protected String fromAddress;

    @Override
    protected void setUrlParamsMap(Map<String, Object> map) {
        map.put("toAddress",address);
        map.put("amount",amount);
        map.put("trace",traceId);
        map.put("fromAddress",fromAddress);
    }

    @Override
    public String getApiUrl() {
        return super.getBaseUrl() + "/wallet/eth_transfer";
    }

    @Override
    public Class<EthTransferResponse> getResponseClass() {
        return EthTransferResponse.class;
    }

    @Override
    public Object getUrlParams() {
        setUrlParamsMap(super.urlParamsMap);
        return super.urlParamsMap;
    }

    @Override
    public ContentType getContentType() {
        return ContentType.create(ContentType.APPLICATION_JSON.getMimeType(),"UTF-8");
    }
}
